<template>
  <div class="container-hoslist">
    <ul class="hos-list">
      <li class="list-item" v-for="(item, index) in hos_list" :key="index" @tap="to_detail(item)">
        <div class="left">
          <!-- 头像 -->
          <div class="hos-logo">
            <img :src="img_url+item.logo" v-if="img_url&&item.logo" alt class="img" />
          </div>
        </div>
        <!-- 医院信息 -->
        <div class="info">
          <div class="hos-name">{{item.name}}</div>
          <div class="address">
            <div class="icon">
              <img :src="base_url+'/mp_2.4/search/dingwei.png'" v-if="base_url" alt class="img" />
            </div>
            <div class="msg">{{item.address}}</div>
          </div>
          <!-- 90天不满意退款 -->
          <div class="tip" v-if="item.label">{{item.label}}</div>
          <!-- 医生数 项目数 -->
          <div class="tags clearfix">
            <div class="tag-item doctor">预约:{{item.reservationNumber}}</div>
            <div class="tag-item project">案例:{{item.caseNumber}}</div>
          </div>
          <!-- 右上角等级 -->
          <div class="leval" v-if="item.tag">
            <div class="msg">{{item.tag}}</div>
          </div>
          <!-- 广告标签 -->
        </div>
        <div class="ad-tag" v-if="item.top==1">广告</div>
      </li>
    </ul>
  </div>
</template>

<script>
import common from "@/assets/js/mmk_common.js";
export default {
  data() {
    return {
      base_url: common.image_resource,
      img_url: common.image_response,
      score: 4
    };
  },
  methods: {
    to_detail(item) {
      wx.navigateTo({ url: "/pages/package_projects/hospital_detail/main?hos_id=" + item.id });
    }
  },
  components: {},
  props: ["hos_list"],
  created() {}
};
</script>

<style lang="less" scoped>
.container-hoslist {
  .hos-list {
    .list-item {
      display: flex;
      padding: 10px 20px;
      background-color: #fff;
      border-bottom: 1px solid rgba(230, 230, 230, 1);
      position: relative;
      .left {
        width: 50px;
        height: 50px;
        position: relative;
        .hos-logo {
          width: 100%;
          height: 100%;
          border-radius: 50%;
          background-color: #ccc;
          .img {
            width: 100%;
            height: 100%;
            display: block;
          }
        }
        .tip {
          width: 11px;
          height: 11px;
          position: absolute;
          bottom: 1px;
          right: 3px;
          .img {
            width: 100%;
          }
        }
      }
      .info {
        flex: 1;
        padding-left: 10px;
        .hos-name {
          font-size: 16px;
          font-family: "PingFangSC-Regular";
          font-weight: 400;
          color: rgba(51, 51, 51, 1);
          line-height: 22px;
        }
        .address {
          margin-top: 5px;
          display: flex;
          .icon {
            width: 12px;
            padding-top: 2px;
            .img {
              width: 11px;
              height: 12px;
              display: block;
            }
          }
          .msg {
            flex: 1;
            font-size: 12px;
            font-family: "PingFangSC-Regular";
            font-weight: 400;
            color: rgba(102, 102, 102, 1);
            line-height: 17px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
          }
        }
        .tip {
          width: 84px;
          height: 16px;
          background: rgba(255, 211, 156, 1);
          box-shadow: 0px 1px 1px 0px rgba(255, 91, 118, 0.42);
          border-radius: 11px;
          font-size: 10px;
          font-family: "PingFangSC-Medium", "PingFang SC";
          font-weight: 500;
          color: rgba(255, 255, 255, 1);
          line-height: 16px;
          text-align: center;
          margin-top: 10px;
        }
        .tags {
          margin-top: 10px;
          .tag-item {
            width: auto;
            height: 20px;
            // border-radius: 10px;
            font-size: 12px;
            font-family: "PingFangSC-Regular";
            font-weight: 400;
            color: #999;
            line-height: 20px;
            text-align: center;
            float: left;
            margin-right: 5px;
          }
          .project {
            padding-left: 10px;
          }
          .doctor {
            position: relative;
            padding-right: 10px;
            &.doctor::after {
              position: absolute;
              content: "";
              width: 3px;
              height: 10px;
              background: rgba(216, 216, 216, 1);
              border-radius: 2px;
              top: 30%;
              right: -10%;
            }
            // background: rgba(255, 133, 154, 1);
          }
        }
      }
      .leval {
        position: absolute;
        top: 13px;
        right: 15px;
        .msg {
          padding-left: 12px;
          padding-right: 6px;
          height: 15px;
          line-height: 15px;
          background: rgba(255, 152, 108, 1);
          box-shadow: 0px 1px 1px 0px rgba(255, 91, 118, 0.42);
          border-radius: 7px;
          font-size: 10px;
          font-family: PingFangSC-Medium;
          font-weight: 500;
          color: rgba(255, 255, 255, 1);
          position: relative;
          &::before {
            content: "";
            width: 18px;
            height: 18px;
            line-height: 18px;
            text-align: center;
            border-radius: 50%;
            display: block;
            background-image: url("https://h5.ameimeika.com/mp_images/mp_2.4/search/vvvvv@2x.png");
            background-repeat: no-repeat;
            background-size: cover;
            box-shadow: 0px 1px 2px 0px rgba(255, 98, 117, 0.61);
            position: absolute;
            left: 0;
            top: 50%;
            transform: translate(-50%, -50%);
            font-size: 12px;
            font-weight: 500;
            color: rgba(255, 255, 255, 1);
          }
        }
      }
      .ad-tag {
        width: 26px;
        height: 11px;
        font-size: 8px;
        font-family: PingFangSC-Medium, PingFang SC;
        font-weight: 500;
        color: rgba(255, 255, 255, 1);
        line-height: 11px;
        position: absolute;
        right: 10px;
        bottom: 10px;
        background: rgba(51, 51, 51, 0.4);
        border-radius:2px;
        text-align: center;
        line-height: 11px;
      }
    }
  }
}
</style>


